package gov.bls.ncs.orsdb.service;

import java.util.ArrayList;

import gov.bls.ncs.orsdb.vos.physical.PhysicalByOccVO;
import gov.bls.ncs.orsdb.vos.physical.PhysicalIncOfReqByOccGrpVO;
import gov.bls.ncs.orsdb.vos.physical.PhysicalReqByOccGrpVO;
import gov.bls.ncs.orsdb.vos.physical.PhysicalVO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/PhyEnvSvc")
public class PhysEnvController {

@Autowired
PhysEnvService peSvc;	

@RequestMapping(value="getPhysEnvData", method=RequestMethod.GET, produces="application/json")
public @ResponseBody PhysicalVO getphysEnvMogData(@RequestParam(required=true)int selected){
	
	  System.out.println("Selected value is :"+selected);
	PhysicalVO physEnvObj = new PhysicalVO();
	
	ArrayList<PhysicalByOccVO> physEnvByOccList;
	physEnvByOccList = peSvc.getPhysEnvByOccList();


ArrayList<PhysicalIncOfReqByOccGrpVO> physEnvIncOfReqByOccGrpList;
physEnvIncOfReqByOccGrpList = peSvc.getPhysEnvIncOfReqByOccGrpList();

ArrayList<PhysicalReqByOccGrpVO> PhysEnvReqByOccGrpList;
PhysEnvReqByOccGrpList = peSvc.getPhysEnvReqByOccGrpList();

physEnvObj.setPhysEnvByOccList(physEnvByOccList);
physEnvObj.setPhysEnvIncOfReqByOccGrpList(physEnvIncOfReqByOccGrpList);
physEnvObj.setPhysEnvReqByOccGrpList(PhysEnvReqByOccGrpList);

return physEnvObj;
}	
}
